package BehaviorModel.mementoModel;

import java.util.ArrayList;
import java.util.List;

/**
 * 功能描述: 管理着
 * 2024/05/12
 * <p>
 * ZhangYi
 */
public class Caretaker {

    private List<Memento> mementoList = new ArrayList<>();

    public void add(Memento state) {
        mementoList.add(state);
    }

    public Memento get(int index) {
        return mementoList.get(index);
    }

    public int getSize() {
        return mementoList.size();
    }

    public void clear() {
        mementoList.clear();
    }
}
